-
Notifications
You must be signed in to change notification settings - Fork 240
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Problem: versiondb lag behind when os reboot #1304
Conversation
Closes: crypto-org-chain#1301 Solution: - do fsync when writing versiondb
Warning Rate Limit Exceeded@yihuang has exceeded the limit for the number of commits or files that can be reviewed per hour. Please wait 28 minutes and 42 seconds before requesting another review. How to resolve this issue?After the wait time has elapsed, a review can be triggered using the We recommend that you space out your commits to avoid hitting the rate limit. How do rate limits work?CodeRabbit enforces hourly rate limits for each developer per organization. WalkthroughThe changes aim to ensure data integrity by introducing a mechanism to flush data to disk immediately in Changes
Assessment against linked issues
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configration File (
|
Signed-off-by: yihuang <huang@crypto.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (2)
- CHANGELOG.md (1 hunks)
- versiondb/tsrocksdb/store.go (2 hunks)
Additional comments: 3
versiondb/tsrocksdb/store.go (2)
- 29-30: The introduction of
defaultSyncWriteOpts
with the intention to enablefsync
during write operations is a critical change for ensuring data integrity. This approach is aligned with the PR's objective to mitigate the risk of version mismatches after unexpected shutdowns.- 34-36: The configuration of
defaultSyncWriteOpts
in theinit
function to enable synchronization with the underlying storage usingSetSync(true)
is correctly implemented. This ensures that every write operation using these options will be followed by anfsync
.CHANGELOG.md (1)
- 8-8: The addition of the changelog entry "Write versiondb with fsync" effectively communicates the key change introduced in this pull request. It's concise and directly references the core improvement made to the versiondb writes. This entry helps in keeping the project's documentation up to date and provides clear information to the users about the enhancements in data integrity.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #1304 +/- ##
==========================================
+ Coverage 35.88% 35.89% +0.01%
==========================================
Files 116 116
Lines 10698 10700 +2
==========================================
+ Hits 3839 3841 +2
Misses 6482 6482
Partials 377 377
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review Status
Actionable comments generated: 1
Configuration used: CodeRabbit UI
Files selected for processing (2)
- CHANGELOG.md (1 hunks)
- app/app.go (1 hunks)
Files skipped from review as they are similar to previous changes (1)
- CHANGELOG.md
* Problem: versiondb lag behind when os reboot Closes: crypto-org-chain#1301 Solution: - do fsync when writing versiondb * Update CHANGELOG.md Signed-off-by: yihuang <huang@crypto.com> * relax version checking * changelog --------- Signed-off-by: yihuang <huang@crypto.com>
* Problem: versiondb lag behind when os reboot Closes: crypto-org-chain#1301 Solution: - do fsync when writing versiondb * Update CHANGELOG.md Signed-off-by: yihuang <huang@crypto.com> * relax version checking * changelog --------- Signed-off-by: yihuang <huang@crypto.com>
…1306) * Problem: memiavl rootmulti store access map concurrently (#1302) * Problem: memiavl rootmulti store access map concurrently Solution: - code refactoring * Update CHANGELOG.md Signed-off-by: yihuang <huang@crypto.com> --------- Signed-off-by: yihuang <huang@crypto.com> * mod tidy * Problem: versiondb lag behind when os reboot (#1304) * Problem: versiondb lag behind when os reboot Closes: #1301 Solution: - do fsync when writing versiondb * Update CHANGELOG.md Signed-off-by: yihuang <huang@crypto.com> * relax version checking * changelog --------- Signed-off-by: yihuang <huang@crypto.com> * fix lint --------- Signed-off-by: yihuang <huang@crypto.com> Co-authored-by: yihuang <huang@crypto.com>
Closes: #1301
Solution:
see: #1304 (comment), this change should cover most version mismatch cases, the only edge case left can be fixed by the default
cronosd rollback
command.👮🏻👮🏻👮🏻 !!!! REFERENCE THE PROBLEM YOUR ARE SOLVING IN THE PR TITLE AND DESCRIBE YOUR SOLUTION HERE !!!! DO NOT FORGET !!!! 👮🏻👮🏻👮🏻
PR Checklist:
make
)make test
)go fmt
)golangci-lint run
)go list -json -m all | nancy sleuth
)Thank you for your code, it's appreciated! :)
Summary by CodeRabbit